
#!/bin/sh

PROGRAM_DIR=`dirname $0`

process="dispatch_server"

count=`ps -ef |grep "${process}" |grep -v grep |grep -v sh|wc -l`
echo "${process} $count"

if [ $count -lt 1 ]; then

echo "[`date +'%Y-%m-%d %T'`] process number:$count, restart it!"
cd ${PROGRAM_DIR};./start.sh
fi
